<?php
/**
 * Object Relational Persistence Mapping Class for table: queue
 *
 * @package	com.clearhealth
 * @author	ClearHealth Inc.
 */
class Queue extends ORDataObject {

	/**#@+
	 * Fields of table: queue mapped to class members
	 */
	var $queue_id		= '';
	var $type		= '';
	/**#@-*/


	/**
	 * DB Table
	 */
	var $_table = 'queue';

	/**
	 * Primary Key
	 */
	var $_key = 'queue_id';
	
	/**
	 * Internal Name
	 */
	var $_internalName = 'Queue';

	/**
	 * Handle instantiation
	 */
	function Queue() {
		parent::ORDataObject();
	}

	public function getIdFromType($type) {
		$sql = "SELECT queue_id FROM queue where type='" . $type . "'";
		$res = $this->_execute($sql);
		if ($res &&!$res->EOF) {
			return $res->fields['queue_id'];		
		}
		return false;
	}
}
?>
